package com.mystudy.jcu.locks;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * TODO:
 *
 * @author acy
 * @since 2019/06/19 18:56
 */
public class ReentrantLockTest {
	private static final Lock LOCK=new ReentrantLock();

	public static void main(String[] args) {

	}
	public static void needLock(){
		try {
			LOCK.lock();
			TimeUnit.SECONDS.sleep(3);
		} catch (InterruptedException e) {
			e.printStackTrace();
		} finally {
			LOCK.unlock();
		}
	}
}
